﻿@model Round

@{
    ViewBag.Title = "Opret ny runde";
}

<div class="page-header">
    <h1><span class="glyphicon glyphicon-globe"></span> @ViewBag.Title</h1>
</div>

<div class="alert alert-info alert-dismissable">
    <p><b>BEMÆRK</b>: Du kan indberette en runde som værende 'privat'. Private runder tæller ikke på listerne, men medtages kun i statistikker. Runder med kun ét scorekort, som ikke er markeret som 'privat', fjernes automatisk løbende af systemet.</p>
</div>

@if (!ViewData.ModelState.IsValid)
{
    <div class="alert alert-danger alert-dismissable">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
        @Html.ValidationSummary("", new { @style = "color: #fff;" })
    </div>
}

@using (Html.BeginForm("Create", "Round", FormMethod.Post, new { role = "form", @class = "form-horizontal" }))
{
    @*<div class="form-group">
        <label for="DateEntry" class="col-sm-2 col-lg-2 control-label">dato</label>
        <div class="col-sm-2">
            <div class="input-group">
                <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                <input type="text" id="DateEntry" name="DateEntry" class="form-control datepicker" required placeholder="dato" value="@Model.DateEntry.ToShortDateString()">
            </div>
        </div>
    </div>*@
    
    @Html.EditorFor(x => x.DateEntry, new { maxDate = DateTime.Today })
    
    <div class="form-group">
        <label for="CourseId" class="col-sm-2 col-lg-2 control-label">klub</label>
        <div class="col-sm-6">
            <div class="input-group">
                <span class="input-group-addon"><span class="glyphicon glyphicon-globe"></span></span>
                @Html.DropDownListFor(m => m.CourseId, new SelectList(ViewBag.Courses, "Id", "NameForDropdown"), "Vælg klub", new { @class = "form-control", required = "required" })
            </div>
        </div>
    </div>
    <div class="form-group">
        <label for="EventId" class="col-sm-2 col-lg-2 control-label">event</label>
        <div class="col-sm-6">
            <div class="input-group">
                <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                @Html.DropDownListFor(m => m.EventId, new SelectList(ViewBag.Events, "Id", "NameForDropdown"), "Vælg eventuelt event..", new { @class = "form-control" })
            </div>
        </div>
    </div>

    <div class="form-group">
        <label for="IsPrivate" class="col-sm-2 col-lg-2 control-label">privat?</label>
        <div class="col-sm-8">
            @Html.CheckBoxFor(model => model.IsPrivate)
        </div>
    </div>

    <div class="form-group">
        <label for="create" class="col-sm-2 col-lg-2 control-label"></label>
        <div class="col-sm-8">
            <button type="submit" class="btn btn-default">opret</button>
        </div>
    </div>
}
@section Scripts {
    @Scripts.Render("~/bundles/globalize")
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/Scripts/_thecup_editing.js")
}
